-- #lazgen HEADER#
/*
	spGoalStatusCreate.

	This procedure creates a new single Goal Status in the database.
*/
SET ANSI_NULLS ON
GO

ALTER PROCEDURE [spGoalStatusCreate]
(		
	@id INT OUT,
	@title VARCHAR( 50 ),
	@description TEXT,
	@created DATETIME OUT,
	@modified DATETIME

) AS
		
BEGIN
-- #endlazgen HEADER#

-- #lazgen BODY#

BEGIN TRANSACTION;

SET @created = CURRENT_TIMESTAMP;

INSERT [tblGoalStatus]
(
	[Title],
	[Description],
	[Created],
	[Modified]
)
VALUES
(
   @Title,
   @Description,
   @Created,
   @Modified
)

			
IF @@ERROR <> 0 
BEGIN
   -- Return 99 to the calling program to indicate failure.
   PRINT 'An error occurred.'
   ROLLBACK TRANSACTION;
   RETURN(99)
END

SET @id = SCOPE_IDENTITY();
		
COMMIT TRANSACTION;

-- #endlazgen BODY#


-- #lazgen FOOTER#

END

GO

SET ANSI_NULLS OFF
GO   
-- #endlazgen FOOTER#
